Skip to content

fix(tests): keep VCR cassette open during setup_and_teardown teardown#583

Closed
michael-richey wants to merge 1 commit into
mainfrom
fix/notebooks-teardown-vcr-ordering
Closed

fix(tests): keep VCR cassette open during setup_and_teardown teardown#583
michael-richey wants to merge 1 commit into
mainfrom
fix/notebooks-teardown-vcr-ordering

Conversation

@michael-richey
Copy link
Copy Markdown
Collaborator

Summary

  • setup_and_teardown (class autouse) and vcr (plugin autouse) had no explicit dependency, so pytest could finalize vcr first — closing the cassette and unpatching aiohttp before the teardown phase ran.
  • The teardown then made real HTTP calls that timed out after 30 s in CI (TimeoutError while getting resources users).
  • Fix: add vcr as an explicit parameter to setup_and_teardown, which guarantees pytest keeps the cassette open until after teardown completes.

Test plan

  • CI integration tests pass (specifically TestNotebooksResources.test_resource_import teardown — the test that was failing with a 30 s timeout in feat(notebooks): lightweight LIST + per-id GET #567's CI run)
  • No other integration test teardowns regress (all other resource types use the same BaseResourcesTestClass)

🤖 Generated with Claude Code

Declare vcr as an explicit fixture parameter so pytest finalises it
after setup_and_teardown, not before. Without the dependency the
teardown phase could run after the cassette was closed, causing real
aiohttp calls that time out (30 s) in CI.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@michael-richey
Copy link
Copy Markdown
Collaborator Author

Closing — exploring a non-VCR approach to fix the teardown failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant